package com.jinmdz.fmis.dao.admin.dao.provider;

import org.apache.ibatis.jdbc.SQL;

/**
 * 接运车辆维护Provider
 *
 * @author LiCongLu
 * @date 2020-03-10 11:05
 */
public class CarProvider {

    /**
     * 查询所有接运车辆信息
     *
     * @param
     * @return
     * @author LiCongLu
     * @date 2020-03-10 11:06
     */
    public String listCarList() {
        return new SQL() {
            {
                StringBuilder builder = new StringBuilder();
                builder.append(" transport_car.id,car_type_code,car_belong_code,car_code,car_no,transport_price,transport_car.disable_state");
                builder.append(" ,driver_user_id,transport_car.sort,transport_car.remark,transport_car.version");
                builder.append(" ,system_user.full_name as driver_user_name");
                SELECT(builder.toString());
                FROM(" transport_car ");
                LEFT_OUTER_JOIN(" system_user on system_user.id = transport_car.driver_user_id ");
                WHERE(" transport_car.deleted = 0 ");
                ORDER_BY(" transport_car.sort ");
            }
        }.toString();
    }
}
